body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  box-sizing: border-box;
  height: 100vh;
  overflow-y: auto;
  color: #333;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Header styles */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: #f9f9f9;
  border-bottom: 1px solid #ddd;
}

h1 {
  font-size: 18px;
  color: #333;
  margin: 0;
}

.header-buttons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #666;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Status message */
.status-message {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 20px;
  color: #666;
}

.status-message .success {
  color: #155724;
}

.status-message .error {
  color: #721c24;
}

.status-message .info {
  color: #0c5460;
}

/* Layout */
.main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 0 16px;
}

/* Sidebar */
.sidebar {
  display: flex;
  padding: 8px;
  background-color: #f9f9f9;
  border-bottom: 1px solid #eee;
}

.sidebar-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #666;
  min-width: 60px;
}

.sidebar-btn .icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.sidebar-btn .label {
  font-size: 12px;
}

.sidebar-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.sidebar-btn.active {
  background-color: rgba(66, 133, 244, 0.1);
  color: #4285f4;
}

/* Video info */
.video-info {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.video-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-channel {
  font-size: 14px;
  color: #666;
}

/* Action buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  padding: 12px 0;
}

.primary-btn {
  background-color: #4285f4;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
  flex: 1;
}

.primary-btn:hover {
  background-color: #3367d6;
}

.primary-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

/* Chat interface styles */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: white;
  border: 1px solid #eee;
  margin-top: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background-color: #f9f9f9;
}

.chat-message {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 18px;
  position: relative;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  background-color: #4285f4;
  color: white;
  border-bottom-right-radius: 4px;
  font-size: 15px;
}

.ai-message {
  align-self: flex-start;
  background-color: #f1f1f1;
  color: #333;
  border-bottom-left-radius: 4px;
  font-size: 15px;
}

.system-message {
  align-self: center;
  background-color: #f8f9fa;
  color: #666;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 12px;
  max-width: 90%;
}

.chat-input-container {
  display: flex;
  padding: 10px;
  background-color: white;
  border-top: 1px solid #eee;
  position: relative;
}

.chat-input {
  flex: 1;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 10px 14px;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  background-color: #f9f9f9;
}

.chat-input:focus {
  border-color: #4285f4;
  background-color: white;
}

.input-buttons {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-left: 8px;
}

.send-message-btn {
  background-color: #4285f4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-message-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.send-icon {
  font-size: 18px;
}

.input-hint {
  font-size: 12px;
  color: #999;
  text-align: right;
  padding: 4px 10px;
}

/* Markdown content */
.markdown-content {
  line-height: 1.5;
}

.markdown-content p {
  margin: 0 0 10px 0;
}

.markdown-content ul, .markdown-content ol {
  margin: 0 0 10px 0;
  padding-left: 20px;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3, 
.markdown-content h4, .markdown-content h5, .markdown-content h6 {
  margin: 16px 0 8px 0;
}

.markdown-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.markdown-content pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0 0 10px 0;
}

.markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Settings panel */
.settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: white;
  z-index: 10;
  padding: 16px;
  overflow-y: auto;
}

.settings-panel h2 {
  font-size: 18px;
  margin: 0 0 16px 0;
  color: #333;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ollama-settings, #openai-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 8px;
}

label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

input, select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

input:focus, select:focus {
  border-color: #4285f4;
}

textarea {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}

input:focus, select:focus, textarea:focus {
  border-color: #4285f4;
  outline: none;
}

.ollama-cors-info {
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  margin-top: 8px;
  font-size: 13px;
}

.ollama-cors-info .info-text {
  margin: 0 0 8px 0;
  color: #555;
}

.ollama-cors-info code {
  display: block;
  background-color: #f1f1f1;
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.ollama-cors-info strong {
  font-weight: 600;
} 